//
//  AFNetTool.h
//  SuperNews
//
//  Created by qiang on 16/1/8.
//  Copyright © 2016年 qiang. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, YZQResponseStyle) {
    YZQJSON,
    YZQXML,
    YZQDATA,
};

typedef NS_ENUM(NSUInteger, YZQRequesrtStyle) {
    YZQRequesrtJOSN,
    YZQRequesrtString,
};

@interface AFNetTool : NSObject

/**
 *  get请求
 *
 *  @param url           请求网址
 *  @param body          body体
 *  @param headFile      请求头
 *  @param responseStyle 返回数据类型
 *  @param success       请求成功回调
 *  @param failure       请求失败回调
 */

+ (void)getNetWithURL:(NSString *)url
                 body:(id)body
             headFile:(NSDictionary *)headFile
        responseStyle:(YZQResponseStyle)responseStyle
              success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
              failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;


/**
 *  post请求
 *
 *  @param url           请求网址
 *  @param body          body体
 *  @param requestStyle  请求的body的类型
 *  @param headFile      请求头
 *  @param responseStyle 返回数据类型
 *  @param success       请求成功回调
 *  @param failure       请求失败回调
 */
+ (void)postNetWithURL:(NSString *)url
                  body:(id)body
             bodyStyle:(YZQRequesrtStyle)requestStyle
              headFile:(NSDictionary *)headFile
         responseStyle:(YZQResponseStyle)responseStyle
               success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
               failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

@end
